]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
dateMenu: Fix possible crash with unknown locations
authorBastien Nocera <hadess@hadess.net>
Mon, 4 Dec 2017 13:30:01 +0000 (14:30 +0100)
committerBastien Nocera <hadess@hadess.net>
Wed, 6 Dec 2017 01:02:48 +0000 (02:02 +0100)
If there are locations unknown to the libgweather version gnome-shell is
using, don't crash.

JS ERROR: TypeError: b.location is null
WorldClocksSection<._clocksChanged/<@resource:///org/gnome/shell/ui/dateMenu.js:141:1
WorldClocksSection<._clocksChanged@resource:///org/gnome/shell/ui/dateMenu.js:139:9

https://bugzilla.gnome.org/show_bug.cgi?id=791148

js/ui/dateMenu.js

index 5908c904f4e96769384087e298a5e1fc7bbdf183..e732e0b1cdd87a0b4efae46b79fdc085ababf889 100644 (file)
@@ -135,7 +135,8 @@ var WorldClocksSection = new Lang.Class({
             if (!clocks[i].location)
                 continue;
             let l = world.deserialize(clocks[i].location);
-            this._locations.push({ location: l });
+            if (l)
+                this._locations.push({ location: l });
         }
 
         this._locations.sort(function(a, b) {